﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FuncWorks.Xna.UI.Menu
{
    public class BooleanItem : MenuItemWithValue
    {
        public bool Value { get; set; }

        string trueValue;
        string falseValue;

		public BooleanItem(string title, TextAlignment alignment, string trueValue, string falseValue, bool startValue)
			: base(title, alignment)
        {
            this.trueValue = trueValue;
            this.falseValue = falseValue;
            Value = startValue;
        }

        protected override void ApplyLimits() { }

        protected override string  DisplayedValue
		{
			get { return Value ? trueValue : falseValue; }
		}

        public override void Activate()
        {
            Value = !Value;
        }

        public override void MoveLeft()
        {
            Value = !Value;
        }

        public override void MoveRight()
        {
            Value = !Value;
        }

    }
}
